package com.lesso.yjy.sunflower.infra.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.lesso.yjy.sunflower.model.EmployeeAttendanceRule;
import com.lesso.yjy.sunflower.pojo.dto.EmployeeAttendanceRuleQueryDTO;
import com.lesso.yjy.sunflower.pojo.vo.EmployeeAttendanceRuleVO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

public interface EmployeeAttendanceRuleMapper extends BaseMapper<EmployeeAttendanceRule> {
    @Select("SELECT COUNT(1) FROM base_employee WHERE id = #{employeeId} AND del_status = 0")
    int checkEmployeeExists(Long employeeId);

    @Select("SELECT COUNT(1) FROM base_attendance_rule WHERE rule_code = #{ruleCode} AND del_status = 0")
    int checkRuleExists(String ruleCode);

    List<EmployeeAttendanceRuleVO> selectPageList(RowBounds rowBounds, EmployeeAttendanceRuleQueryDTO dto);
}
